Skip to content

Write a trinomial with conjugate roots over its roots in the square - #1948

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
write-a-trinomial-with-conjugate-roots-over-them
Oct 19, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
write-a-trinomial-with-conjugate-roots-over-them

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Fixes #1885.

When a + b x^2 + c x^4 has complex roots in x^2, the integrator wrote it as two real quadratics, c (x^2 + p x + m)(x^2 - p x + m), and that writing produced the long answers. Writing it over its two roots in x^2, c (x^2 - r)(x^2 - s), was ruled out because the piece answers were piecewise on signs and so became NaN for complex r. They no longer have sign cases: each piece over x^2 - r is arctan(w x / sqrt(d + e x^2)) with w^2 = (d + e r)/(-r), which holds on either branch. So one writing now serves real and complex roots, and the conjugate pieces add up to a real antiderivative.

Characters in the answer, on master 4e5ae5f:

integrand master this PR
x^2 sqrt(d + k x^2)/(a + b x^2 + c x^4) 29,139 3,572
sqrt(d + k x^2)/(a + b x^2 + c x^4) 9,582 1,161
1/((a + b x^2 + c x^4) sqrt(d + k x^2)) 9,310 1,051
x^4/((a + b x^2 + c x^4) sqrt(d + k x^2)) 28,551 3,254
(d + k x^2)^(3/2)/(a + b x^2 + c x^4) 31,242 3,713

Checks:

  • Each answer agrees exactly with its integrand at 50, 300 and 2000 digits, for complex roots (also with k < 0) and for real roots.
  • Evaluated on a grid of 81 points, every antiderivative is real and has no jumps.
  • The new test asserts the size bound, the derivative, and that the answer is real.

Rubi checks, against master, with no wrong answers anywhere:

  • The 300 rows of 1.2.2.4 (f x)^m (d + e x^2)^q (a + b x^2 + c x^4)^p: 299 → 300 solved. The row that moved was re-run on its own: 0/1 on master, 1/1 here.
  • Families 0 and 1 in full, plus samples of families 2–8: identical results.
  • The allocation gate and the full suite pass (15,590 passed).

2.5.0 answered none of these integrands, so no BREAKING-CHANGES entry.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

The pieces over x^2 - r beside the root of a quadratic are case-free now,
so one writing over the two roots holds for complex r as well as real, and
the conjugate pieces sum to a real, continuous antiderivative. Answers over
a + b x^2 + c x^4 with b^2 < 4 a c drop from 9-31K characters to 1-4K.

Fixes #1885.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 19, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 8a1ef45 into master Oct 19, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 19, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the write-a-trinomial-with-conjugate-roots-over-them branch October 29, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Integrals over a trinomial with complex roots in x^2 beside a root are long

1 participant